var mongoose = require("mongoose");
var db = mongoose.connection;
var settingsSchema = new mongoose.Schema({
	//名称
	name:{type:String , required:true},
	profiles:{type:String}
});
var settingsS = db.model("webSettings" , settingsSchema);
//类
function Settings(){};
//设置
Settings.prototype.update = function(data , callback){
	settingsS.update({} , data , function(error , data){
		if(error){
			return callback("操作失败");
		};
		return callback(null , data);
	});
};
//获取
Settings.prototype.get = function(callback){
	settingsS.find({} , function(error , data){
		if(error){
			return callback("操作失败");
		};
		return callback(null , data);
	})
};
//接口
module.exports = Settings;
